#include<stdio.h>
#include<string.h>                                                              
#include<unistd.h>
#include<pthread.h>
#include<fcntl.h>

int main(int argc, char* argv[])
{
    char buf[1024];
    int fd;
    int read_count;
    int pid = fork();

    if(pid==0)
    {
        fd=open("./slient_wfifo",O_WRONLY);
        while(1)
        {
            read_count = read(0,buf,sizeof(buf));
            write(fd,buf,read_count);
        }
    }
    else
    {
        fd=open("./server_wfifo",O_RDONLY);
        while(1)
        {
            read_count = read(fd,buf,sizeof(buf));
            write(1,buf,read_count);
        }
    }
    return 0;
}


